# 最低版本
cmake_minimum_required (VERSION 3.28)

# 项目名称
project (ssl_sdk)

# 获取C源文件
aux_source_directory(src/ SRCS)
# 引入头文件路径
include_directories(include)
# 引入库文件路径
link_directories(${PROJECT_SOURCE_DIR}/lib64)

# 生成可执行文件
add_executable(htssl ${SRCS})

# 添加库文件
# set(LIBS pthread config ssl crypto)
set(LIBS pthread config)

# 添加编译选项
add_compile_options(-static)

# 配置可执行文件输出路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# 把库连接到可执行文件
# target_link_libraries(htssl ${LIBS})
target_link_libraries(htssl /opt/tongsuo/lib64/libssl.a)
target_link_libraries(htssl /opt/tongsuo/lib64/libcrypto.a)
target_link_libraries(htssl ${LIBS})
